import Vue from 'vue';
import Router from 'vue-router';
import {BASE_PATH} from "../common/api";

Vue.use(Router);

export default new Router({
  mode: 'history',
  base: BASE_PATH,
  routes: [
    {
      path: '/',
      // component: Home,
      name: 'Home',
      redirect: {name:'MemberRecommend'}
    },
    {
      path: '',
      // component: Main,
      redirect: {name:'MemberRecommend'}
    },
    {
      path: '/main',
      component: () => import('../views/Main'),
      name: 'Main',
      meta: {
        title: '缘分',
        authentication: 'non',
        keepAlive: true //此组件需要被缓存
      }
    },
    {
      path: '/user_login',
      component: () => import('../views/user/Login'),
      name: 'UserLogin',
      meta: {
        title: '登录',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/user_register',
      component: () => import('../views/user/Register'),
      name: 'UserRegister',
      meta: {
        title: '注册',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/user_redirect',
      component: () => import('../views/user/Redirect'),
      name: 'UserRedirect',
      meta: {
        title: '登录',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/college_index',
      component: () => import('../views/college/Index'),
      name: 'CollegeIndex',
      meta: {
        title: '学院',
        authentication: 'non',
        keepAlive: true
      }
    },
    {
      path: '/college_course',
      component: () => import('../views/college/Course'),
      name: 'CollegeCourse',
      meta: {
        title: '课程',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/college_course_signin',
      component: () => import('../views/college/SignIn'),
      name: 'CollegeCourseSignIn',
      meta: {
        title: '课程签到',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/message_index',
      component: () => import('../views/message/Index'),
      name: 'MessageIndex',
      meta: {
        title: '消息',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/message_send',
      component: () => import('../views/message/Send'),
      name: 'MessageSend',
      meta: {
        title: '发消息',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/message_notice_list',
      component: () => import('../views/message/notice/List'),
      name: 'MessageNoticeList',
      meta: {
        title: '系统通知',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_index',
      component: () => import('../views/my/Index'),
      name: 'MyIndex',
      meta: {
        title: '我的',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/member_index',
      component: () => import('../views/member/Index'),
      name: 'MemberIndex',
      meta: {
        title: '缘分',
        authentication: 'login',
        keepAlive: true
      }
    },
    {
      path: '/member_recommend',
      component: () => import('../views/member/Recommend'),
      name: 'MemberRecommend',
      meta: {
        title: '缘分',
        authentication: 'non',
        keepAlive: true
      }
    },
    {
      path: '/member_profile',
      component: () => import('../views/member/Profile'),
      name: 'MemberProfile',
      meta: {
        title: '缘分',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/activity_index',
      component: () => import('../views/activity/Index'),
      name: 'ActivityIndex',
      meta: {
        title: '活动',
        authentication: 'non',
        keepAlive: true
      }
    },
    {
      path: '/activity_detail',
      component: () => import('../views/activity/Detail'),
      name: 'ActivityDetail',
      meta: {
        title: '活动',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/activity_signin',
      component: () => import('../views/activity/SignIn'),
      name: 'ActivitySignIn',
      meta: {
        title: '活动签到',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/vip_buy',
      component: () => import('../views/vip/Buy'),
      name: 'VipBuy',
      meta: {
        title: '开通/升级VIP',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/vip_rights',
      component: () => import('../views/vip/Rights'),
      name: 'VipRights',
      meta: {
        title: 'VIP权益',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/report',
      component: () => import('../views/Report'),
      name: 'Report',
      meta: {
        title: '举报',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/matchmaker_index',
      component: () => import('../views/matchmaker/Index'),
      name: 'MatchmakerIndex',
      meta: {
        title: '兼职红娘',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/my_profile',
      component: () => import('../views/my/profile/Index'),
      name: 'MyProfileIndex',
      meta: {
        title: '我的资料',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_profile_base',
      component: () => import('../views/my/profile/Base'),
      name: 'MyProfileBase',
      meta: {
        title: '基本资料',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_profile_expect',
      component: () => import('../views/my/profile/Expect'),
      name: 'MyProfileExpect',
      meta: {
        title: '择偶要求',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_profile_intro',
      component: () => import('../views/my/profile/Intro'),
      name: 'MyProfileIntro',
      meta: {
        title: '个人介绍',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_profile_house_status',
      component: () => import('../views/my/profile/HouseStatus'),
      name: 'MyProfileHouseStatus',
      meta: {
        title: '房产情况',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_profile_expect_house_status',
      component: () => import('../views/my/profile/ExpectHouseStatus'),
      name: 'MyProfileExpectHouseStatus',
      meta: {
        title: '房产要求',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_album_index',
      component: () => import('../views/my/album/Index'),
      name: 'MyAlbumIndex',
      meta: {
        title: '我的相册',
        authentication: 'login',
        keepAlive: false
      }
    },

    {
      path: '/my_activity_index',
      component: () => import('../views/my/activity/Index'),
      name: 'MyActivityIndex',
      meta: {
        title: '我的活动',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_auth_index',
      component: () => import('../views/my/auth/Index'),
      name: 'MyAuthIndex',
      meta: {
        title: '诚信认证',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_auth_faceid',
      component: () => import('../views/my/auth/FaceId'),
      name: 'MyAuthFaceId',
      meta: {
        title: '实名认证',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_auth_car',
      component: () => import('../views/my/auth/Car'),
      name: 'MyAuthCar',
      meta: {
        title: '汽车认证',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_auth_education',
      component: () => import('../views/my/auth/Education'),
      name: 'MyAuthEducation',
      meta: {
        title: '学历认证',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_auth_house',
      component: () => import('../views/my/auth/House'),
      name: 'MyAuthHouse',
      meta: {
        title: '房产认证',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_auth_marriage',
      component: () => import('../views/my/auth/Marriage'),
      name: 'MyAuthMarriage',
      meta: {
        title: '婚姻状况认证',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_course_index',
      component: () => import('../views/my/course/Index'),
      name: 'MyCourseIndex',
      meta: {
        title: '我的课程',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_course_order',
      component: () => import('../views/my/course/Order'),
      name: 'MyCourseOrder',
      meta: {
        title: '我的课程',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_follow_index',
      component: () => import('../views/my/follow/Index'),
      name: 'MyFollowIndex',
      meta: {
        title: '我关注的',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_friends_intro',
      component: () => import('../views/my/friends/Index'),
      name: 'MyFriendsIndex',
      meta: {
        title: '我的好友',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_visitor_index',
      component: () => import('../views/my/visitor/Index'),
      name: 'MyVisitorIndex',
      meta: {
        title: '我的访客',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_setting_index',
      component: () => import('../views/my/setting/Index'),
      name: 'MySettingIndex',
      meta: {
        title: '设置',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_setting_receive_money',
      component: () => import('../views/my/setting/ReceiveMoney'),
      name: 'MySettingReceiveMoney',
      meta: {
        title: '收款账号',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/service_index',
      component: () => import('../views/service/Index'),
      name: 'ServiceIndex',
      meta: {
        title: '服务套餐',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/my_service_index',
      component: () => import('../views/my/service/Index'),
      name: 'MyServiceIndex',
      meta: {
        title: '我的服务',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_service_detail',
      component: () => import('../views/my/service/Detail'),
      name: 'MyServiceDetail',
      meta: {
        title: '我的服务',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_matchmaker_index',
      component: () => import('../views/my/matchmaker/Index'),
      name: 'MyMatchmakerIndex',
      meta: {
        title: '我的推广',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_wallet_index',
      component: () => import('../views/my/wallet/Index'),
      name: 'MyWalletIndex',
      meta: {
        title: '钱包',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_wallet_withdraw',
      component: () => import('../views/my/wallet/Withdraw'),
      name: 'MyWalletWithdraw',
      meta: {
        title: '提现',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_member_profile_exchange_apply_list',
      component: () => import('../views/my/member_profile_apply/List'),
      name: 'MyMemberProfileApplyList',
      meta: {
        title: '交友申请',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/my_member_profile_exchange_apply_detail',
      component: () => import('../views/my/member_profile_apply/Detail'),
      name: 'MyMemberProfileApplyDetail',
      meta: {
        title: '交友申请',
        authentication: 'login',
        keepAlive: false
      }
    },
    {
      path: '/marketing_activity',
      component: () => import('../views/marketing/Activity'),
      name: 'MarketingActivity',
      meta: {
        title: '活动',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/vipcard_index',
      component: () => import('../views/vipcard/Index'),
      name: 'VipcardIndex',
      meta: {
        title: '会员卡',
        authentication: 'non',
        keepAlive: false
      }
    },

    {
      path: '/about',
      component: () => import('../views/About'),
      name: 'About',
      meta: {
        title: '关于我们',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/privacy_policy',
      component: () => import('../views/PrivacyPolicy'),
      name: 'PrivacyPolicy',
      meta: {
        title: '隐私政策',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/terms_conditions',
      component: () => import('../views/TermsConditions'),
      name: 'TermsConditions',
      meta: {
        title: '用户协议',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/third_info',
      component: () => import('../views/ThirdInfo'),
      name: 'ThirdInfo',
      meta: {
        title: '第三方SDK使用说明文档',
        authentication: 'non',
        keepAlive: false
      }
    },

    {
      path: '/404',
      component: () => import('../components/404.vue'),
      name: 'NotFound',
      meta: {
        title: '找不到页面',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '/unauthorized',
      component: () => import('../components/Unauthorized'),
      name: 'Unauthorized',
      meta: {
        title: '未授权',
        authentication: 'non',
        keepAlive: false
      }
    },
    {
      path: '*',
      // redirect: {path: '/404'}
      redirect: {name:'Home'}
    }
  ]
})
